function gm_sum = calculate_series(g, vx, vz, params)
    % 计算无穷级数和
    tolerance = 1e-10;
    gm_sum = 0;
    
    for m = 1:params.m_max
        term = (g.^m ./ 1.308) .* exp(-(vx + vz .* params.A .* ...
            (2*pi/params.lambda)).^2 .* params.T^2 ./ (4 .* m));
        gm_sum = gm_sum + term;
        
        % 检查收敛性
        if max(abs(term)) < tolerance
            fprintf('级数在m=%d时收敛\n', m);
            break;
        end
    end
end 